/*
 *   Copyright 2023 <a href="mailto:asialjim@hotmail.com">Asial Jim</a>
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */
package com.asialjim.encommunicate.base.rsa.util;

import com.asialjim.encommunicate.base.rsa.RSAKeyPairProperty;
import com.asialjim.encommunicate.base.rsa.key.RSAKeys;
import com.asialjim.encommunicate.base.rsa.key.RSAServerKey;

/**
 * RSA 服务端工具
 *
 * @author Copyright © <a href="mailto:asialjim@hotmail.com">Asial Jim</a>   Co., LTD
 * @version 1.0
 * @since 2023/2/27, &nbsp;&nbsp; <em>version:1.0</em>, &nbsp;&nbsp; <em>java version:17</em>
 */
public class RSAServerUtil extends AbstractRSAUtil {

    public RSAServerUtil(RSAKeyPairProperty keyPairProperty) {
        super(keyPairProperty);
    }

    public RSAServerUtil(RSAServerKey serverKey){
        super(RSAKeyPairProperty.builder().priKey(serverKey.getPriKey()).pubKey(serverKey.getPubKey()).build());
    }

    public RSAServerUtil(RSAKeys keys){
        super(RSAKeyPairProperty.builder().priKey(keys.getServerKey().getPriKey()).pubKey(keys.getServerKey().getPubKey()).build());
    }

    public RSAServerUtil(String priKey, String pubKey){
        super(RSAKeyPairProperty.builder().priKey(priKey).pubKey(pubKey).build());
    }
}